<!doctype html>
<html lang="zh">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="Shortcut Icon" href="https://guofeifei.com/favicon.ico" />
    <title>倒计时器-在线倒计时,秒表计时器 time tool</title>
    <meta name="keywords" content="倒计时器,在线倒计时,秒表计时器">
		<meta name="description" content="倒计时器提供计时器，倒计时，秒表计时，网页倒计时，在线计时器，秒表计时器，倒计时在线使用等。">
		<link rel="stylesheet" type="text/css" href="css/all.css">
		<script src="js/jquery.js"></script>
<script type="text/javascript">
        var iTime = "";
        var Account;
        var didiaudio= new Audio("didi.mp3");
function didi(control) {
          if (control){
          	didiaudio.play();
          	didiaudio.loop = true;
          	//显示关闭按钮
          	}else{
          		didiaudio.pause();
          		}  
          
        } 
        
        function doit() {
        //    document.getElementById("endtime").style.display="block";
            var endt;
            var a = document.getElementById("h").value;
            var b = document.getElementById("m").value; ;
            var c = document.getElementById("s").value; ;
            if (a == "00" && b == "00" && c == "00") {
                alert("请输入开始时间！");
            }
            else {
                endt = Number(a * 3600) + Number(b * 60) + Number(c);
                iTime = endt;
                RemainTime();
                form1.elements["startButton"].className = "beg2";
                form1.elements["stopButton"].className = "beg";
                //播放滴滴
								didi(true);
            }
        }
        function stop() {
        //    document.getElementById("endtime").style.display="none";
            document.getElementById("endtime").innerHTML = "<span>00</span>:<span>00</span>:<span>00</span>";
            document.getElementById("h").value = "00";
            document.getElementById("m").value = "00";
            document.getElementById("s").value = "00";

            form1.elements["startButton"].className = "beg";
            form1.elements["stopButton"].className = "beg2";
            clearTimeout(Account);
            //停止滴滴
						didi(false);
        }


function RemainTime() {
            var audio= new Audio("10mdaojishiqi.mp3");
            var G=document.getElementById("tishi").value;
            var iDay, iHour, iMinute, iSecond;
            var sDay = "", sHour = "", sMinute = "", sSecond = "", sTime = "";
            if (iTime >= 0) {

                iHour = parseInt((iTime / 3600) % 24);
                if (iHour > 0) {
                    if (iHour < 10) {
                        sHour = "<span>" + "0" + iHour + "</span>";
                    }
                    else {
                        sHour = "<span>" + iHour + "</span>";
                    }
                }
                iMinute = parseInt((iTime / 60) % 60);
                if (iMinute > 0) {
                    if (iMinute < 10) {
                        sMinute = "<span>" + "0" + iMinute + "</span>";
                    }
                    else {
                        sMinute = "<span>" + iMinute + "</span>";
                    }
                }
                iSecond = parseInt(iTime % 60);
                if (iSecond >= 0) {
                    if (iSecond < 10) {
                        sSecond ="<span>" + "0" + iSecond + "</span>";
                    }
                    else {
                        sSecond = "<span>" + iSecond + "</span>";
                    }
                }
                if ((sDay == "") && (sHour == "") && (sMinute == "")) {
                    sTime = "<span>" + "0" + "0" + "</span>" + ":<span>" + "0" + "0" + "</span>" + ":<span>" + sSecond + "</span>";
                }
                else if ((sDay == "") && (sHour == "")) {
                    sTime = "<span>" + "0" + "0" + "</span>" + ":<span>" + sMinute + "</span>" + ":<span>" + sSecond + "</span>";
                }
                else if ((sDay == "") && (sMinute == "")) {
                    sTime = "<span>" + sHour + "</span>" + ":<span>" + "0" + "0" + "</span>" + ":<span>" + sSecond + "</span>";
                }
                else {
                    sTime ="<span>" + sHour + "</span>" + ":<span>" + sMinute + "</span>" + ":<span>" + sSecond + "</span>";
                }
                if (iTime == 9) {
                    audio.play();
                }
                if (iTime == 0) {
                    clearTimeout(Account);
                    stop();
                    sTime = "<span>00</span>:<span>00</span>:<span>00</span>";
                    //alert("时间到了！");
       if(G==""){  //判断输入信息
          alert("时间到了！");
        }else{
          alert(G);
        }
                }
                else {
                    Account = setTimeout("RemainTime()", 1000);
                }
                iTime = iTime - 1;
            }
            else {

                alert("倒计时结束！");
            }
            document.getElementById("endtime").innerHTML = sTime;
        } 
function xs()
{
document.getElementById('tp').style.display='block';
document.getElementById('wz').style.display='none';
}
function yc()
{
document.getElementById('tp').style.display='none';
document.getElementById('wz').style.display='block';
}
</script>
  </head>
  <body>
  	
  	<div id="bigdiv"><div class="nrt">
<div class="nrlg"><a href="https://www.guofeifei.com/">首页</a>&nbsp;&nbsp;</div>
<span class="dazi">倒计时器</span>&nbsp; <h1>在线倒计时,秒表计时器</h1>
<div class="dhc"><a rel="nofollow" href="https://guofeifei.com/login/">登陆</a>&nbsp;&nbsp;<a rel="nofollow" href="https://guofeifei.com/register/">注册</a></div>
</div>
<div class="clear"></div>
<div class="nrs">
	
<p><b>在线倒计时器</b>：输入要倒计的时长，倒计时器将按秒表倒数计时，倒数9秒开始有声音提示，倒计时结束将弹出提示。<span onclick="tishi.style.display=tishi.style.display=='none'?'':'none';" style="font-size:13px;color:#0099CC;cursor:pointer">设置提示</span> <input type="text" id="tishi" value="时间到了" size="16" style="display:none;">

             滴滴声 <input type="button"  name="resetbutton" id="didiButton" onclick="didi(true)"  value="开"> <input type="button"  name="resetbutton" id="didiButton" onclick="didi(false)"  value="关">
</p>
<form id="form1">
	
            <div class="inputs">
            	
              <input name="text" type="text" class="inputbnt2" id="h" onkeyup="this.value=this.value.replace(/\D/g,'')" value="00" maxlength="2" onafterpaste="this.value=this.value.replace(/\D/g,'')">小时
              <input name="text2" type="text" class="inputbnt2" id="m" onkeyup="this.value=this.value.replace(/\D/g,'')" value="00" maxlength="2" onafterpaste="this.value=this.value.replace(/\D/g,'')">分钟
              <input name="text2" type="text" class="inputbnt2" id="s" onkeyup="this.value=this.value.replace(/\D/g,'')" value="00" maxlength="2" onafterpaste="this.value=this.value.replace(/\D/g,'')">秒　
              <input name="button" type="button" class="beg" id="startButton" onclick="doit();" value="开始">
              <input name="button" type="button" class="beg2" id="stopButton" onclick="stop();" value="取消">
              </div> 
<div id="endtime"><span>00</span>:<span>00</span>:<span>00</span></div>
</form>
<script type="text/javascript" src="//a.guofeifei.com/production/t/openjs/olqq-x/common/pq/k.js"></script>
</p><p></p><p><b>秒表计时器</b>：点击"开始"秒表即开始计时，还能分次计时，点击"清除"可将秒表计时器初始化。</p>
<div id="miaobiao_k">
<form name="stopwatch" id="stopwatch" title="Stopwatch">
<input type="button" onclick="stopstart()" onfocus="this.blur()" name="startstopbutton" id="startstopbutton" title="开始 / 停止" value="开始">
<input type="button" onclick="dosplit()" onfocus="this.blur()" name="splitbutton" id="splitbutton" title="计次" value="计次">
<input type="button" name="disp" id="disp" title="秒表" value="00:00:00.000">
<input type="button" onclick="reset_it()" onfocus="this.blur()" name="resetbutton" id="resetbutton" title="清除" value="清除">
</form>
</div>
<div id="split"></div>
<script type="text/javascript">
var t=[0, 0, 0, 0, 0, 0, 0, 1];
var firstsplitflag = 0;
var splittime;




function stopstart() {
t[t[2]]=(new Date()).valueOf();
t[2]=1-t[2];

if (0==t[2]) {
clearInterval(t[4]);
t[3]+=t[1]-t[0];
document.getElementById("startstopbutton").value="开始";
document.getElementById('split').innerHTML+=
(t[7]++)+' 停止: '+format(t[1]-t[0])+'<br />';
t[4]=t[1]=t[0]=0;
disp();
firstsplitflag = 0;

} else {
document.getElementById("startstopbutton").value="停止";
t[4]=setInterval(disp, 43);
//播放滴滴
didi(true);
}
}
function dosplit(){
if(0!==t[2])
{
document.getElementById('split').innerHTML+=
(t[7]++)+' 计次: '+format(t[1]-t[0])+'<br>';
}
}
function reset_it() {
if (t[2]) stopstart();
t[4]=t[3]=t[2]=t[1]=t[0]=0;
disp();
document.getElementById('split').innerHTML='';
t[7]=1;
}

function disp() {
if (t[2]) t[1]=(new Date()).valueOf();
t[6].value=format(t[3]+t[1]-t[0]);
}
function format(ms) {
var d=new Date(ms+t[5]).toString()
.replace(/.*([0-9][0-9]:[0-9][0-9]:[0-9][0-9]).*/, '$1');
var x=String(ms%1000);
while (x.length<3) x='0'+x;
d+='.'+x;
return d;
}

function load() {
t[5]=new Date(1970, 1, 1, 0, 0, 0, 0).valueOf();
t[6]=document.getElementById('disp');

disp();
}
load();
</script>
</div>

<script language="javascript">
<!--
function show_date_time(trq,bjq){
var rq=trq;
var bj=bjq;
window.setTimeout("show_date_time('"+rq+"','"+bj+"')", 1000);

BirthDay=new Date(""+rq+"");//日期设定
today=new Date();
timeold=(BirthDay.getTime()-today.getTime())+1000;
sectimeold=timeold/1000
secondsold=Math.floor(sectimeold);
msPerDay=24*60*60*1000
e_daysold=timeold/msPerDay
daysold=Math.floor(e_daysold);
e_hrsold=(e_daysold-daysold)*24;
hrsold=Math.floor(e_hrsold);
e_minsold=(e_hrsold-hrsold)*60;
minsold=Math.floor((e_hrsold-hrsold)*60);
seconds=Math.floor((e_minsold-minsold)*60);
timeold2=(BirthDay.getTime()-today.getTime());
sectimeold2=(timeold2/1000)
secondsold2=Math.floor(sectimeold2);
e_daysold2=timeold2/msPerDay
daysold2=Math.floor(e_daysold2);
e_hrsold2=(e_daysold2-daysold2)*24;
hrsold2=Math.floor(e_hrsold2);
e_minsold2=(e_hrsold2-hrsold2)*60;
minsold2=Math.floor((e_hrsold2-hrsold2)*60);
seconds2=Math.floor((e_minsold2-minsold2)*60);
//document.getElementById(""+bj+"").innerHTML="<font color=red>"+daysold+"天"+hrsold+"时"+minsold+"分"+seconds+"秒</font>" ; 
if(1==2 && parseInt(daysold,10) < 0)  
 {    
document.getElementById(""+bj+"").innerHTML="<font color=green>"+Math.abs(daysold2+1)+"天"+(23-hrsold2)+"时"+(59-minsold2)+"分"+(59-seconds2)+"秒</font>" ;  
 }
 
}
show_date_time('6-1-2020 0:0:0','djs71');show_date_time('6-5-2020 12:58:18','djs72');show_date_time('6-19-2020 0:0:0','djs107');show_date_time('6-20-2020 0:0:0','djs105');show_date_time('6-21-2020 0:0:0','djs17');show_date_time('6-21-2020 5:43:33','djs73');show_date_time('6-25-2020 0:0:0','djs18');
//-->



</script>
</div>


</body></html>